# $Id$
# Contributor: Alexander Baldeck <alexander@archlinux.org>
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=mcpp
pkgver=2.7.2
pkgrel=6
pkgdesc="Matsui's CPP implementation precisely conformed to standards"
arch=('x86_64')
license=('custom')
url="http://mcpp.sourceforge.net"
depends=('glibc')
source=(https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz
        namlen.patch
        fs28284.patch)
sha256sums=('3b9b4421888519876c4fc68ade324a3bbd81ceeb7092ecdbbc2055099fcb8864'
            'ee8bf97c42150d2424a5984baec8227a44538e15c23cec93aabfc65daf9a6081'
            '27e42d8cae06327370cf0f9a8118d23a2f9368b87f24b38a9cb9c0c4eaeadb4e')

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../namlen.patch
  patch -Np1 -i ../fs28284.patch
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --enable-mcpplib --disable-static
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="${pkgdir}" install

  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  ln -sf ../../doc/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/"
}
